package auto.dao;

import java.util.List;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import auto.domain.Request;




@Repository
public class RequestDAOImplNoTemplate implements RequestDAO {
	
	private SessionFactory sessionFactory;
	
	@Autowired
	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

	@Override
	@Transactional
	public void saveRequest(Request request) {
		System.out.println("Uso la sessione per salvare");
		sessionFactory.getCurrentSession().save(request);
	}
	
	@Override
	@SuppressWarnings("unchecked")
	public List<Request> listRequest() {
		return null;
	}

}
